package sdk

Import Path
	github.com/K-Phoen/sdk (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 35 packages


Package-Level Type Names (total 90)
/* sort by: | */
Interval string Name string Rules []AlertRule
Params []string
Type string UID string
Params []float64 Type string
type AlertObjectMatcher ([...])
Type string
Params []string Type string
// seconds // seconds
for a graph panel Decimals int Format string Label string LogBase int Max *FloatString Min *FloatString Show bool
Board represents Grafana dashboard. Annotations struct{List []Annotation} Editable bool GraphTooltip int HideControls bool ID uint Links []Link OriginalTitle string Panels []*Panel Refresh *BoolString Rows []*Row SchemaVersion uint SharedCrosshair bool Slug string Style string Tags []string Templating Templating Time Time Timepicker Timepicker Timezone string Title string UID string Version uint (*Board) AddLink(link Link) (*Board) AddRow(title string) *Row (*Board) AddTags(tags ...string) (*Board) HasTag(tag string) bool (*Board) RemoveTags(tags ...string) (*Board) UpdateSlug() string func NewBoard(title string) *Board func github.com/K-Phoen/grabana/dashboard.(*Builder).Internal() *Board func github.com/K-Phoen/grabana/row.New(board *Board, title string, options ...row.Option) (*row.Row, error)
Flag bool Value *int64 ( BoolInt) MarshalJSON() ([]byte, error) (*BoolInt) UnmarshalJSON(raw []byte) error BoolInt : github.com/goccy/go-json.Marshaler *BoolInt : github.com/goccy/go-json.Unmarshaler BoolInt : encoding/json.Marshaler *BoolInt : encoding/json.Unmarshaler
Flag bool Value string ( BoolString) MarshalJSON() ([]byte, error) (*BoolString) UnmarshalJSON(raw []byte) error BoolString : github.com/goccy/go-json.Marshaler *BoolString : github.com/goccy/go-json.Unmarshaler BoolString : encoding/json.Marshaler *BoolString : encoding/json.Unmarshaler
for a table TextType string Value string
// metrics // general Editable bool Error bool GridPos struct{H *int; W *int; X *int; Y *int} // general HideTimeOverride *bool ID uint IsNew bool // general // templating options // it required for defining type of the panel // display styles // templating options RepeatDirection *RepeatDirection RepeatIteration *int64 `json:"repeatIteration,omitempty"` ScopedVars map[string]struct{Selected bool; Text string; Value string} // general // general Transparent bool Type string
DisableResolveMessage bool Name string SecureSettings map[string]interface{} Settings map[string]interface{} Type string UID string
for templateVar Tags []*string Text *StringSliceString // TODO select more precise type
func (*Row).AddCustom(data *CustomPanel)
FolderID int Headings bool Limit int Mode string Query string Recent bool Search bool Starred bool Tags []string func (*Row).AddDashlist(data *DashlistPanel)
DatasourceRef is used to reference a datasource from panels, queries, etc. LegacyName is the old way of referencing a datasource by its name, replaced in Grafana v8.4.3 by Type and UID referencing. If datasource is encoded as a string, then it's unmarshaled into this LegacyName field (Type and UID will be empty). If LegacyName is not empty, then this DatasourceRef will be marshaled as a string, ignoring the values of Type and UID. Type describes the type of the datasource, like "prometheus", "graphite", etc. Datasources of the same type should support same queries. If Type is empty in an unmarshaled DatasourceRef, check the LegacyName field. UID is the uid of the specific datasource this references to. ( DatasourceRef) MarshalJSON() ([]byte, error) (*DatasourceRef) UnmarshalJSON(data []byte) error DatasourceRef : github.com/goccy/go-json.Marshaler *DatasourceRef : github.com/goccy/go-json.Unmarshaler DatasourceRef : encoding/json.Marshaler *DatasourceRef : encoding/json.Unmarshaler
Defaults FieldConfigDefaults Overrides []FieldConfigOverride func github.com/K-Phoen/grabana/scheme.New(fieldConfig *FieldConfig, options ...scheme.Option) *scheme.Scheme func github.com/K-Phoen/grabana/timeseries/axis.New(fieldConfig *FieldConfig, options ...axis.Option) (*axis.Axis, error) func github.com/K-Phoen/grabana/timeseries/threshold.New(fieldConfig *FieldConfig, options ...threshold.Option) *threshold.Threshold
FixedColor string Mode string SeriesBy string
Matcher struct{ID string; Options string} Properties []FieldConfigOverrideProperty
ID string Value interface{}
FloatString represents special type for json values that could be strings or ints: 100 or "100" Valid bool Value float64 MarshalJSON implements custom marshalling for FloatString type UnmarshalJSON implements custom unmarshalling for FloatString type *FloatString : github.com/goccy/go-json.Marshaler *FloatString : github.com/goccy/go-json.Unmarshaler *FloatString : encoding/json.Marshaler *FloatString : encoding/json.Unmarshaler func NewFloatString(i float64) *FloatString
Cards struct{CardPadding *float64; CardRound *float64} Color struct{CardColor string; ColorScale string; ColorScheme string; Exponent float64; Min *float64; Max *float64; Mode string} DataFormat string HideZeroBuckets bool HighlightCards bool Legend struct{Show bool} ReverseYBuckets bool Targets []Target Tooltip struct{Show bool; ShowHistogram bool} TooltipDecimals int XAxis struct{Show bool} XBucketNumber *float64 XBucketSize *string YAxis struct{Decimals *int; Format string; LogBase int; Show bool; Max *string; Min *string; SplitFactor *float64} YBucketBound string YBucketNumber *float64 YBucketSize *float64
Height of rows maybe passed as number (ex 200) or as string (ex "200px") or empty string (*Height) UnmarshalJSON(raw []byte) error *Height : github.com/goccy/go-json.Unmarshaler *Height : encoding/json.Unmarshaler
IntString represents special type for json values that could be strings or ints: 100 or "100" Valid bool Value int64 MarshalJSON implements custom marshalling for IntString type UnmarshalJSON implements custom unmarshalling for IntString type *IntString : github.com/goccy/go-json.Marshaler *IntString : github.com/goccy/go-json.Unmarshaler *IntString : encoding/json.Marshaler *IntString : encoding/json.Unmarshaler func NewIntString(i int64) *IntString
Options LogsOptions Targets []Target
Name *string Value *int
Map of template name → template
Default group bys Default timing settings GroupWait string Default alert receiver RepeatInterval string Routing policies
Default timing settings overrides GroupWait string ObjectMatchers []AlertObjectMatcher Alert receiver RepeatInterval string
for templateVar Selected bool Text string Value string
Panel represents panels of different types defined in Grafana. AlertlistPanel *AlertlistPanel AlertlistPanel.DashboardTags []string AlertlistPanel.NameFilter string AlertlistPanel.OnlyAlertsOnDashboard bool AlertlistPanel.Show string AlertlistPanel.SortOrder int AlertlistPanel.StateFilter []string BarGaugePanel *BarGaugePanel CommonPanel CommonPanel // metrics // general CommonPanel.Editable bool CommonPanel.Error bool CommonPanel.GridPos struct{H *int; W *int; X *int; Y *int} // general CommonPanel.HideTimeOverride *bool CommonPanel.ID uint CommonPanel.IsNew bool // general // templating options // it required for defining type of the panel // display styles // templating options CommonPanel.RepeatDirection *RepeatDirection RepeatIteration *int64 `json:"repeatIteration,omitempty"` CommonPanel.ScopedVars map[string]struct{Selected bool; Text string; Value string} // general // general CommonPanel.Transparent bool CommonPanel.Type string CustomPanel *CustomPanel DashlistPanel *DashlistPanel DashlistPanel.FolderID int DashlistPanel.Headings bool DashlistPanel.Query string DashlistPanel.Recent bool DashlistPanel.Search bool DashlistPanel.Starred bool DashlistPanel.Tags []string GaugePanel *GaugePanel Should be initialized only one type of panels. OfType field defines which of types below will be used. // XXX GraphPanel.Bars bool GraphPanel.DashLength *uint GraphPanel.Dashes *bool GraphPanel.Fill int GraphPanel.LeftYAxisLabel *string GraphPanel.Lines bool GraphPanel.Linewidth uint GraphPanel.Percentage bool GraphPanel.Pointradius float32 GraphPanel.Points bool GraphPanel.RightYAxisLabel *string GraphPanel.SeriesOverrides []SeriesOverride GraphPanel.SpaceLength *uint GraphPanel.Stack bool GraphPanel.SteppedLine bool GraphPanel.TimeFrom *string GraphPanel.TimeShift *string // was added in Grafana 4.x? GraphPanel.YFormats []string // was added in Grafana 4.x? HeatmapPanel *HeatmapPanel HeatmapPanel.Cards struct{CardPadding *float64; CardRound *float64} HeatmapPanel.Color struct{CardColor string; ColorScale string; ColorScheme string; Exponent float64; Min *float64; Max *float64; Mode string} HeatmapPanel.DataFormat string HeatmapPanel.HideZeroBuckets bool HeatmapPanel.HighlightCards bool HeatmapPanel.ReverseYBuckets bool HeatmapPanel.TooltipDecimals int HeatmapPanel.XBucketNumber *float64 HeatmapPanel.XBucketSize *string HeatmapPanel.YBucketBound string HeatmapPanel.YBucketNumber *float64 HeatmapPanel.YBucketSize *float64 LogsPanel *LogsPanel PluginlistPanel *PluginlistPanel RowPanel *RowPanel RowPanel.Collapsed bool RowPanel.Panels []Panel SinglestatPanel *SinglestatPanel SinglestatPanel.ColorBackground bool SinglestatPanel.ColorValue bool SinglestatPanel.Colors []string SinglestatPanel.Format string SinglestatPanel.Gauge Gauge SinglestatPanel.MappingType *uint SinglestatPanel.MappingTypes []*MapType SinglestatPanel.MaxDataPoints *IntString SinglestatPanel.Postfix *string SinglestatPanel.PostfixFontSize *string SinglestatPanel.Prefix *string SinglestatPanel.PrefixFontSize *string SinglestatPanel.RangeMaps []*RangeMap SinglestatPanel.SparkLine SparkLine SinglestatPanel.ValueFontSize string SinglestatPanel.ValueMaps []ValueMap SinglestatPanel.ValueName string StatPanel *StatPanel TablePanel *TablePanel TablePanel.Columns []Column TablePanel.Transform string TextPanel *TextPanel TextPanel.Content string TextPanel.PageSize uint TextPanel.ShowHeader bool TimeseriesPanel *TimeseriesPanel AddTarget adds a new target as defined in the argument but with refId letter incremented. Value of refID from the argument will be used only if no target with such value already exists. GetTargets iterates over all panel targets. It just returns nil if no targets defined for panel of concrete type. (*Panel) MarshalJSON() ([]byte, error) MapDatasources on all existing targets for the panel. RepeatTargetsForDatasources repeats all existing targets for a panel for all provided in the argument datasources. Existing datasources of targets are ignored. ResetTargets delete all targets defined for a panel. SetTarget updates a target if target with such refId exists or creates a new one. (*Panel) UnmarshalJSON(b []byte) error *Panel : github.com/goccy/go-json.Marshaler *Panel : github.com/goccy/go-json.Unmarshaler *Panel : encoding/json.Marshaler *Panel : encoding/json.Unmarshaler func NewAlertlist(title string) *Panel func NewCustom(title string) *Panel func NewDashlist(title string) *Panel func NewGauge(title string) *Panel func NewGraph(title string) *Panel func NewHeatmap(title string) *Panel func NewLogs(title string) *Panel func NewPluginlist(title string) *Panel func NewSinglestat(title string) *Panel func NewStat(title string) *Panel func NewTable(title string) *Panel func NewText(title string) *Panel func NewTimeseries(title string) *Panel func (*Row).Add(panel *Panel)
Limit int
From *string Text *string To *string
Calcs []string Fields string Values bool
func github.com/K-Phoen/grabana/gauge.RepeatDirection(direction RepeatDirection) gauge.Option func github.com/K-Phoen/grabana/graph.RepeatDirection(direction RepeatDirection) graph.Option func github.com/K-Phoen/grabana/heatmap.RepeatDirection(direction RepeatDirection) heatmap.Option func github.com/K-Phoen/grabana/logs.RepeatDirection(direction RepeatDirection) logs.Option func github.com/K-Phoen/grabana/singlestat.RepeatDirection(direction RepeatDirection) singlestat.Option func github.com/K-Phoen/grabana/stat.RepeatDirection(direction RepeatDirection) stat.Option func github.com/K-Phoen/grabana/timeseries.RepeatDirection(direction RepeatDirection) timeseries.Option const RepeatDirectionHorizontal const RepeatDirectionVertical
Row represents single row of Grafana dashboard. Collapse bool Editable bool Height Height Panels []Panel Repeat *string ShowTitle bool Title string (*Row) Add(panel *Panel) (*Row) AddCustom(data *CustomPanel) (*Row) AddDashlist(data *DashlistPanel) (*Row) AddGraph(data *GraphPanel) (*Row) AddSinglestat(data *SinglestatPanel) (*Row) AddStat(data *StatPanel) (*Row) AddTable(data *TablePanel) (*Row) AddText(data *TextPanel) func (*Board).AddRow(title string) *Row
Collapsed bool Panels []Panel
for a graph panel Col int Desc bool
for a stat FillColor *string Full bool LineColor *string Show bool YMax *float64 YMin *float64
StackdriverAlignOption defines a single alignment option shown in Grafana during query configuration. Label string MetricKinds []string Text string Value string ValueTypes []string
StackdriverAlignOptions defines the list of alignment options shown in Grafana during query configuration. Expanded bool Label string Options []StackdriverAlignOption
FieldConfig FieldConfig Options StatOptions Targets []Target func (*Row).AddStat(data *StatPanel)
StringSliceString represents special type for json values that could be strings or slice of strings: "something" or ["something"]. Valid bool Value []string MarshalJSON implements custom marshalling for StringSliceString type. UnmarshalJSON implements custom unmarshalling for StringSliceString type. *StringSliceString : github.com/goccy/go-json.Marshaler *StringSliceString : github.com/goccy/go-json.Unmarshaler *StringSliceString : encoding/json.Marshaler *StringSliceString : encoding/json.Unmarshaler
Columns []Column // from grafana 3.x Sort *Sort Styles []ColumnStyle Targets []Target Transform string func (*Row).AddTable(data *TablePanel)
for an any panel Alias string AliasBy string AlignOptions []StackdriverAlignOptions AlignmentPeriod string BucketAggs []struct{ID string; Field string; Type string; Settings struct{Interval string; MinDocCount interface{}; Order string; OrderBy string; Size string}} CrossSeriesReducer string Datasource *DatasourceRef Dimensions map[string]string For Elasticsearch For Prometheus Filters []string Format string Group []struct{Type string; Params []string} GroupBys []string Hide bool Instant bool Interval string IntervalFactor int LegendFormat string For InfluxDB MetricColumn string MetricKind string MetricName string MetricType string Metrics []struct{ID string; Field string; Type string} For CloudWatch PerSeriesAligner string Period string Preprocessor string For the Stackdriver data source. Find out more information at https:/grafana.com/docs/grafana/v6.0/features/datasources/stackdriver/ Query string RawQuery bool RawSql string RefID string Region string Select [][]struct{Params []string; Type string} Statistics []string Step int For PostgreSQL Tags []struct{Key string; Operator string; Value string} For Graphite TimeColumn string TimeField string ValueType string Where []struct{Type string; Name string; Params []string; Datatype string} func (*Panel).GetTargets() *[]Target func (*Panel).AddTarget(t *Target) func (*Panel).SetTarget(t *Target)
List []TemplateVar
TitleSize int ValueSize int
Content string FieldConfig FieldConfig Mode string Options struct{Content string; Mode string} PageSize uint Scroll bool ShowHeader bool Sort Sort Styles []ColumnStyle func (*Row).AddText(data *TextPanel)
critical, warning, ok, custom Fill bool hexadecimal color (e.g. #629e51, only when ColorMode is "custom") Line bool hexadecimal color (e.g. #629e51, only when ColorMode is "custom") gt or lt the alert threshold value, we do not omitempty, since 0 is a valid threshold left or right
Mode string Steps []ThresholdStep
Color string Value *float64
From string To string
Now *bool RefreshIntervals []string TimeOptions []string
Mode string
// was added in Grafana 3.x Shared bool Sort int ValueType string
for a stat Op string TextType string Value string
Package-Level Functions (total 16)
func NewAlertlist(title string) *Panel
func NewBoard(title string) *Board
NewCustom initializes panel with a stat panel.
NewDashlist initializes panel with a dashlist panel.
NewGauge initializes a new panel as a Gauge panel.
NewGraph initializes panel with a graph panel.
func NewHeatmap(title string) *Panel
NewLogs initializes a new panel as a Logs panel.
NewPluginlist initializes panel with a stat panel.
NewSinglestat initializes panel with a singlestat panel.
NewStat initializes panel with a stat panel.
NewTable initializes panel with a table panel.
NewText initializes panel with a text panel.
NewTimeseries initializes panel with a timeseries panel.
Package-Level Constants (total 21)
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
const MixedSource = "-- Mixed --"
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Each panel may be one of these types.
Constants for templating
Constants for templating
Constants for templating
Each panel may be one of these types.
Each panel may be one of these types.